import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { Utility, InfoItemList, RadusButton } from 'components';
import * as CommonActions from 'redux/modules/reduxCommon';
import * as TaskActions from 'redux/modules/reduxTask';
// import { Input } from 'antd';
// const TextArea = Input.TextArea;
const styles = require('./scss/EditTask.scss');

@connect(
  state => ({
    Title: state.Common.Title,                                          // 标题
    UrlParams: state.Common.UrlParams,                                  // URL参数
    peopleList: state.TaskManager.peopleList,                           // 人员列表
    CommonData: state.Common,                                           // 公共数据
    DetailTemp: state.Common.DetailTemp,                                // 保存页面数据
  }),
  { ...CommonActions, ...TaskActions })

export default class EditTask extends Component {
  static propTypes = {
    UrlParams: PropTypes.object,
    peopleList: PropTypes.object,                                       // 人员列表
    CommonData: PropTypes.object,                                       // 公共数据
    DetailTemp: PropTypes.object,                                       // 详情缓存
    onTaskDetail: PropTypes.func,                                       // 查询详情
    onEditTask: PropTypes.func,                                         // 编辑任务
    onGetPeopleList: PropTypes.func,                                    // 获取人员列表
    onExtEditTask: PropTypes.func,                                      // 
    onSetContent: PropTypes.func,                                       // 保存缓存
    onDeleteByFields: PropTypes.func,                                   // 删除数据
  };

  constructor(props) {
    super(props);
    const detail = Utility.getTaskDetail();
    // Utility.removeTaskDetail();
    this.state = { detail: detail };
    console.log(detail);
  }

  componentWillMount() {
    this.__InitDataByRedux();
  }

  componentDidMount() {
    Utility.$emit(Utility.constItem.Events.OnEditLeftAction, false);
    if (!this.state.detail) {
      this.__getTaskDetail();
    }
    this.__InitRef();
    // this.__getTaskDetail();
    // this.__showConfirm('msg');
    this.__InitCache();
  }

  __InitCache() {
    const { workMode, isRepeat, isRemind, execPlan } = this.state.detail;
    if (workMode) {
      this.__WorkMode(workMode);
    }
    if (isRepeat) {
      this.__IsRepeat(isRepeat);
    }
    // if (label) {
    //   this.__Label(label);
    // }
    if (isRemind) {
      this.__Remind(isRemind);
    }
    if (execPlan) {
      this.__ExecutePlan(execPlan);
    }
  }

  /**
   * 获取会议详情
   * 
   * @returns 
   * @memberof InitConerence
   */
  __getTaskDetail() {
    Utility.$loading();
    const { onTaskDetail, UrlParams } = this.props;
    if (!Utility.isFunction(onTaskDetail)) {
      return;
    }
    const taskId = UrlParams.taskId;
    onTaskDetail(taskId).then((result) => {
      Utility.$loadingHide();
      this.setState({ detail: result });
      this.__InitCache();
    }, (error) => {
      Utility.$loadingHide();
      console.log(error);
    });
  }

  /**
   * 初始化缓存
   * 
   * @returns 
   * @memberof EditTask
   */
  __InitDataByRedux() {
    const { CommonData } = this.props;
    if (!CommonData) {
      return;
    }
    const { detail } = this.state;
    const { SelectEndDate, SelectExecutePlanType, SelectLabelType, SelectRemindType, SelectRepeatWay, SelectWorkWay } = Utility.constItem.StateName;
    // 计划类型
    if (CommonData[SelectExecutePlanType]) {
      detail.execPlan = CommonData[SelectExecutePlanType].Value;
    }
    // 标签
    if (CommonData[SelectLabelType]) {
      const lTypes = CommonData[SelectLabelType];
      let str = [];
      const Labels = Object.values(lTypes).sort((a, b) => Number(a.Id) - Number(b.Id));
      // Labels.forEach((item) => {
      //   str += item.Title + ',';
      // });
      str = Labels.map((item) => {
        return item.Title;
      });
      detail.label = str.join(',');
      console.log(detail.label);
      // this.__Label(detail.labe);
      // detail.label = Labels;
    }
    // 提醒
    if (CommonData[SelectRemindType]) {
      detail.isRemind = CommonData[SelectRemindType].Value;
    }
    // 工作方式
    if (CommonData[SelectWorkWay]) {
      detail.workMode = CommonData[SelectWorkWay].Value;
    }
    // 重复方式
    if (CommonData[SelectRepeatWay]) {
      detail.isRepeat = CommonData[SelectRepeatWay].Value;
    }
    // 时间
    if (CommonData[SelectEndDate] && CommonData[SelectEndDate] > 1000000) {
      detail.deadline = CommonData[SelectEndDate];
    }

    this.__UpdateRender();
  }

  /**
   * 更新渲染
   */
  __UpdateRender() {
    if (!!this.state.IsMount) {
      this.setState({ __CurrentTempDate: new Date().getTime() });
    }
  }

  /**
   * 成功回调
   * 
   * @param {any} msg 
   * @param {any} topage 
   * @memberof EditTask
   */
  __ShowSucess(msg, topage, isDelete) {
    const { onSetContent, onDeleteByFields } = this.props;
    const { detail } = this.state;
    const { id } = detail || {};
    // const taskId = UrlParams.taskId;
    if (!!isDelete) {
      onDeleteByFields('RelationTaskList', { Key: 'id', Value: id });
      onDeleteByFields('TaskRelatedList', { Key: 'id', Value: id });
    }
    const { SelectEndDate, SelectExecutePlanType, SelectLabelType, SelectRemindType, SelectRepeatWay, SelectWorkWay } = Utility.constItem.StateName;
    onSetContent('DealtDetailTemp', null);
    onSetContent(SelectExecutePlanType, null);
    onSetContent(SelectLabelType, null);
    onSetContent(SelectRemindType, null);
    onSetContent(SelectRepeatWay, null);
    onSetContent(SelectWorkWay, null);
    onSetContent(SelectEndDate, null);
    onSetContent(Utility.constItem.StateName.DealtDetail, null);
    Utility.$showToast(msg, 'iconAllRight', this.__toPage(topage), 500);
  }

  /**
   * 失败回调
   * 
   * @param {any} msg 
   * @param {any} dismisCallback 
   * @memberof EditTask
   */
  __ShowFail(msg, dismisCallback) {
    Utility.$showToast(msg, 'iconError', dismisCallback, 500);
  }

  __toPage(Url) {
    const { UrlParams } = this.props;
    const taskId = UrlParams.taskId;
    Utility.toPage(Url, { taskId: taskId });
  }

  __showConfirm(msg) {
    const { OnConfirm } = Utility.constItem.Events.ShowModel;
    const option = { Content: msg, Title: '提示', okButton: this.__getTaskDetail.bind(this), cancelButton: this.__getTaskDetail.bind(this) };
    Utility.$emit(OnConfirm, option);
  }

  __onEditContentApi() {
    const input = this.refs.refInput;
    if (!input) {
      return;
    }
    const { content } = this.state.detail;
    if (input.value === content) {
      return;
    }
    if (input.value) {
      const putContent = { content: input.value };
      this.__onEditTask(putContent);
    } else {
      alert('请输入内容');
    }
  }

  /**
   * 创建者修改状态
   * @param {any} arg 
   * @returns 
   * @memberof Task
   */
  __onEditTask(arg, sucesscallback, failcallback) {
    Utility.$loading();
    const { onEditTask, UrlParams } = this.props;
    if (!Utility.isFunction(onEditTask)) {
      return;
    }
    const taskId = UrlParams.taskId;
    onEditTask(taskId, arg).then((result) => {
      Utility.$loadingHide();
      this.setState({ detail: result });
      if (sucesscallback && Utility.isFunction(sucesscallback)) {
        sucesscallback();
      }
    }, (error) => {
      Utility.$loadingHide();
      if (error && error.code === 804) {
        this.__showConfirm(error.message ? error.message : this.__getConfirmTxt(error.code));
      } else if (failcallback && Utility.isFunction(failcallback)) {
        failcallback();
      }
      console.log(error);
    });
  }

  /**
   * 提示信息
   * 
   * @param {any} code 
   * @returns 
   * @memberof EditTask
   */
  __getConfirmTxt(code) {
    if (code) {
      return ('当前任务状态有变化，请重试！');
    }
    return ('当前任务状态有变化，请重试！');
  }

  /**
   * 处理缓存ref
   * 
   * @returns 
   * @memberof EditTask
   */
  __InitRef() {
    const { DetailTemp } = this.props;
    const { content } = DetailTemp || this.state.detail;
    const input = this.refs.refInput;
    if (!input) {
      return;
    }
    input.value = content;
  }

  __HandlerBlur(event) {
    // console.log(event.target.value);
    const { onSetContent } = this.props;
    const __DetailTemp = {};
    __DetailTemp.content = event.target.value;
    onSetContent('DetailTemp', __DetailTemp);
  }

  /**
   * 提交任务
   * 
   * @param {any} isNow 
   * @returns 
   * @memberof EditTask
   */
  __commitTask() {
    // if (!isNow) {
    //   const Buttons = [
    //     {
    //       Title: '修改',
    //       funName: this.__commitTask.bind(this, true)
    //     },
    //   ];
    //   Utility.$showActions('是否修改任务', Buttons);
    //   return;
    // }
    const input = this.refs.refInput;
    if (!input) {
      return;
    }
    const { detail } = this.state;
    const { execPlan, isRemind, deadline, isRepeat, workMode, label } = detail || {};
    // if (input.textAreaRef.value === content) {
    //   return;
    // }
    if (!input.value || input.value === '') {
      Utility.$alert('请输入内容!');
    }

    const data = {
      execPlan: execPlan,
      isRemind: isRemind || '',
      deadline: deadline || '',
      isRepeat: isRepeat || '',
      workMode: workMode || '',
      // label: label ? label.map((item) => item.Title).join(',') : ''
      // label.substring(0, label.lastIndexOf(','));
      label: label ? label : ''
    };
    data.content = input.value;

    if (execPlan !== 'LIGTH') {
      if (deadline < new Date().getTime()) {
        Utility.$alert('截止时间不能小于当前时间');
        return;
      }
    }
    const { GoBack } = Utility.constItem.UrlItem;

    Utility.$actionSheetBtns([
      {
        Title: '是否修改任务', onClick: () => { }
      },
      {
        Title: '修改', onClick: () => {
          Utility.$actionSheetHide();
          setTimeout(() => {
            this.__onEditTask(data, this.__ShowSucess.bind(this, '修改成功', GoBack), this.__ShowFail.bind(this, '修改失败'));
          }, 200);
        }
      }
    ]);

    // const Buttons = [
    //   {
    //     Title: '修改',
    //     funName: this.__onEditTask(data, this.__ShowSucess.bind(this, '修改成功', GoBack), this.__ShowFail.bind(this, '修改失败'))
    //   },
    // ];

    // Utility.$showActions('是否修改任务', Buttons);
  }

  /**
   * 关闭任务
   * 
   * @param {any} isNow 
   * @returns 
   * @memberof EditTask
   */
  __closeTask(isNow) {
    if (!isNow) {
      const Buttons = [
        {
          Title: '确定',
          funName: this.__closeTask.bind(this, true)
        },
      ];
      Utility.$showActions('是否关闭任务', Buttons);
      return;
    }
    const Content = { status: Utility.constItem.Task.Task_OVER };
    this.__onEditTask(Content, this.__ShowSucess.bind(this, '关闭成功', Utility.constItem.UrlItem.GmessageView), this.__ShowFail.bind(this, '关闭失败'));
  }

  /**
   * 删除任务
   * 
   * @param {any} isNow 
   * @returns 
   * @memberof EditTask
   */
  __deleteTask(isNow) {
    if (!isNow) {
      const Buttons = [
        {
          Title: '确定',
          funName: this.__deleteTask.bind(this, true)
        },
      ];
      Utility.$showActions('是否删除任务', Buttons);
      return;
    }
    const Content = { status: Utility.constItem.Task.Task_DELETE };
    this.__onEditTask(Content, this.__ShowSucess.bind(this, '删除成功', Utility.constItem.UrlItem.GmessageView, true), this.__ShowFail.bind(this, '删除失败'));
  }

  /**
   * 接收人(暂时不能选择)
   * 
   * @param {any} extTaskUser 
   * @returns 
   * @memberof EditTask
   */
  __getExtTaskUser(extTaskUser) {
    let ExtTaskUser = '';
    const temp = [];
    if (extTaskUser && extTaskUser.length < 4 && extTaskUser.length > 0) {
      extTaskUser.map((obj) => {
        temp.push(obj.taskUserName);
      });
      ExtTaskUser = temp.join(',');
    } else if (extTaskUser && extTaskUser.length > 3) {
      ExtTaskUser = extTaskUser[0].taskUserName + ',' + extTaskUser[1].taskUserName + ',' + extTaskUser[2].taskUserName + '等' + extTaskUser.length + '人';
    }
    return ExtTaskUser;
  }

  /**
   * 执行计划
   * 
   * @param {any} execPlan 
   * @returns 
   * @memberof Task
   */
  __ExecutePlanHtml(execPlan) {
    if (!execPlan) {
      return null;
    }
    let __executePlan = '轻任务';
    switch (execPlan) {
      case 'LIGTH':
        __executePlan = '轻任务';
        break;
      case 'STANDARD':
        __executePlan = '标准任务';
        break;
      case 'MEETING':
        __executePlan = '晨会';
        break;
      default:
        break;
    }
    return __executePlan;
  }

  /**
   * 执行计划缓存
   * 
   * @param {any} execPlan 
   * @returns 
   * @memberof Task
   */
  __ExecutePlan(execPlan) {
    if (!execPlan) {
      return null;
    }
    const { onSetContent } = this.props;
    let __result = {};
    if (execPlan === 'LIGTH') {
      __result = { Id: 1, Title: '轻任务', Value: 'LIGTH' };
    } else if (execPlan === 'STANDARD') {
      __result = { Id: 2, Title: '标准任务', Value: 'STANDARD' };
    }
    if (Utility.isFunction(onSetContent)) {
      onSetContent(Utility.constItem.StateName.SelectExecutePlanType, __result);
    }
  }

  /**
   * 提醒字段
   * 
   * @param {any} isRemind 
   * @returns 
   * @memberof Task
   */
  __RemindHtml(isRemind) {
    if (!isRemind) {
      return null;
    }
    let __remindTip = '不提醒';
    switch (isRemind) {
      case 'NO':
        __remindTip = '不提醒';
        break;
      case 'QUARTER':
        __remindTip = '截止十五分钟前';
        break;
      case 'HOUR':
        __remindTip = '截止一小时前';
        break;
      case 'THREEHOUR':
        __remindTip = '截止三小时前';
        break;
      case 'ONEDAY':
        __remindTip = '截止前一天';
        break;
      default:
        break;
    }
    return __remindTip;
  }

  /**
   * 提醒字段缓存
   * 
   * @param {any} isRemind 
   * @returns 
   * @memberof Task
   */
  __Remind(isRemind) {
    const { onSetContent } = this.props;
    if (!isRemind) {
      return null;
    }
    switch (isRemind) {
      case 'NO':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRemindType, { Id: 0, Title: '不提醒', Value: 'NO' });
        }
        break;
      case 'QUARTER':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRemindType, { Id: 1, Title: '截止十五分钟前', Value: 'QUARTER' });
        }
        break;
      case 'HOUR':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRemindType, { Id: 2, Title: '截止一小时前', Value: 'HOUR' });
        }
        break;
      case 'THREEHOUR':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRemindType, { Id: 3, Title: '截止三小时前', Value: 'THREEHOUR' });
        }
        break;
      case 'ONEDAY':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRemindType, { Id: 0, Title: '不提醒', Value: 'NO' });
        }
        break;
      default:
        break;
    }
  }

  /**
   * 标签样式
   * 
   * @param {any} label 
   * @returns 
   * @memberof TaskList
   */
  __LabelStyle(label) {
    console.log(label);
    if (!label || label === '') {
      return null;
    }
    const labels = label.split(',');
    if (Utility.isArray(labels)) {
      if (labels[labels.length - 1] === '') {
        labels.pop();
      }
    }
    const result = labels.reverse();
    // if (!Utility.isArray(result)) {
    //   return null;
    // }
    const __label = [];

    const __result = result.slice(0, 3);
    for (let i = 0; i < __result.length; i++) {
      const item = result[i];
      switch (item) {
        case '紧急':
          __label.unshift(<div className={styles.oneStatus} key={'one_status'}>紧急</div>);
          break;
        case '重要':
          __label.unshift(<div className={styles.twoStatus} key={'two_status'}>重要</div>);
          break;
        case '普通':
          __label.unshift(<div className={styles.threeStatus} key={'three_status'}>普通</div>);
          break;
        default:
          // __label.unshift(<div className={styles.defaultCss} key={'other_status'}>{item}</div>);
          break;
      }
    }
    return (<div className={styles.labelContainer}>{__label}</div>);
  }

  /**
   * 标签样式缓存
   * 
   * @param {any} label 
   * @returns 
   * @memberof TaskList
   */
  __Label(label) {
    const { onSetContent } = this.props;
    if (!label || label === '') {
      return null;
    }
    // let result = [];
    const labels = label.split(',');
    if (Utility.isArray(labels)) {
      if (labels[labels.length - 1] === '') {
        labels.pop();
      }
    }
    // labels.pop();
    const result = labels.reverse();
    // if (!Utility.isArray(result)) {
    //   result = ['标签'];
    // } else {
    //   result = label.split(',');
    // }
    if (!Utility.isArray(result)) {
      return null;
    }

    const __result = result.slice(0, 3);
    for (let i = 0; i < __result.length; i++) {
      const item = result[i];
      switch (item) {
        case '紧急':
          if (Utility.isFunction(onSetContent)) {
            onSetContent(Utility.constItem.StateName.SelectLabelType, { Id: 3, Title: '紧急', BgStyle: '03' });
          }
          break;
        case '重要':
          if (Utility.isFunction(onSetContent)) {
            onSetContent(Utility.constItem.StateName.SelectLabelType, { Id: 2, Title: '重要', BgStyle: '02' });
          }
          break;
        case '普通':
          if (Utility.isFunction(onSetContent)) {
            onSetContent(Utility.constItem.StateName.SelectLabelType, { Id: 1, Title: '普通', BgStyle: '01' });
          }
          break;
        default:
          // __label.unshift(<div className={styles.defaultCss} key={'other_status'}>{item}</div>);
          break;
      }
    }
  }

  /**
   * 是否重复
   * 
   * @param {any} isRepeat 
   * @returns 
   * @memberof Task
   */
  __IsRepeatHtml(isRepeat) {
    if (!isRepeat) {
      return null;
    }
    let _isRepeat = '不重复';
    switch (isRepeat) {
      case 'NO':
        _isRepeat = '不重复';
        break;
      case 'DAY':
        _isRepeat = '每天重复';
        break;
      case 'WEEK':
        _isRepeat = '每周重复';
        break;
      default:
        break;
    }
    return _isRepeat;
  }

  /**
   * 是否重复缓存
   * 
   * @param {any} isRepeat 
   * @returns 
   * @memberof Task
   */
  __IsRepeat(isRepeat) {
    const { onSetContent } = this.props;
    if (!isRepeat) {
      return null;
    }
    switch (isRepeat) {
      case 'NO':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRepeatWay, { Id: 1, Title: '不重复', Value: 'NO' });
        }
        break;
      case 'DAY':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRepeatWay, { Id: 2, Title: '每天重复', Value: 'DAY' });
        }
        break;
      case 'WEEK':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectRepeatWay, { Id: 3, Title: '每周重复', Value: 'WEEK' });
        }
        break;
      default:
        break;
    }
  }

  /**
   * 工作方式
   * 
   * @param {any} isRepeat 
   * @returns 
   * @memberof Task
   */
  __WorkModeHtml(workMode) {
    // if (!workMode) {
    //   return null;
    // }
    let _workMode = '无';
    switch (workMode) {
      case 'NO':
        _workMode = '无';
        break;
      case 'TOGETHER':
        _workMode = '多人合作';
        break;
      case 'TEAM':
        _workMode = '多人协作';
        break;
      default:
        _workMode = '无';
        break;
    }
    return _workMode;
  }

  /**
   * 工作方式缓存
   * 
   * @param {any} workMode 
   * @returns 
   * @memberof Task
   */
  __WorkMode(workMode) {
    // if (!workMode) {
    //   return null;
    // }
    const { onSetContent } = this.props;
    switch (workMode) {
      case 'NO':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectWorkWay, { Id: 1, Title: '无', Value: 'NO' });
        }
        break;
      case 'TOGETHER':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectWorkWay, { Id: 2, Title: '多人合作', Value: 'TOGETHER' });
        }
        break;
      case 'TEAM':
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectWorkWay, { Id: 3, Title: '多人协作', Value: 'TEAM' });
        }
        break;
      default:
        if (Utility.isFunction(onSetContent)) {
          onSetContent(Utility.constItem.StateName.SelectWorkWay, { Id: 1, Title: '无', Value: 'NO' });
        }
        break;
    }
  }

  /**
   * 选择日期
   * 
   * @memberof EditTask
   */
  __HandlerOpenDatePicker() {
    const __self = this;
    const { onSetContent } = this.props;
    Utility.$openDatePicker(new Date(), true, (value) => {
      onSetContent(Utility.constItem.StateName.SelectEndDate, value.getTime());
      __self.state.detail.deadline = value.getTime();
      // console.log(__self.state.detail.deadline);
      __self.__UpdateRender();
    });
  }

  /**
   * 复制任务
   * 
   * @memberof EditTask
   */
  __HandlerCopyTask() {
    const { onSetContent } = this.props;
    const { ToGMessage } = Utility.constItem.UrlItem;
    const { uuid } = this.state.detail;
    this.state.detail.gocomGroup = this.state.detail.group;
    onSetContent(Utility.constItem.StateName.DealtDetail, this.state.detail);
    if (uuid) {
      Utility.toPage(ToGMessage, { id: uuid, isCopy: 1 });
    }
  }

  render() {
    // const { fromUserTrueName} = this.state.detail || {};
    const { content, extTaskUser, execPlan, label, isRemind, isRepeat, workMode, deadline } = this.state.detail || {};
    const placeholder = '请输入任务描述';
    const { ExecutivePeople, SelectExecutePlan, SelectWorkWay, SelectLabel, SelectRemind, SelectRepeatWay } = Utility.constItem.UrlItem;
    // 默认截止时间加一天
    // const __CurrentDate = new Date();
    // __CurrentDate.setDate(__CurrentDate.getDate() + 1);
    // const EndTimes = __CurrentDate.getTime();
    // 若没有截止时间 默认设置成当天时间的18点
    const dt = new Date();
    dt.setHours(18);
    dt.setMinutes(0);
    const EndTimes = dt.getTime();

    const __formatDay = 'yyyy-MM-dd hh : mm';
    const __day = Utility.$convertToDateByTimestamp(deadline ? deadline : EndTimes, __formatDay);

    const plan = [
      { name: '执行计划', value: execPlan ? this.__ExecutePlanHtml(execPlan) : '轻任务', onItemClick: () => { Utility.toPage(SelectExecutePlan, {}); }, showRight: true },
    ];

    const standardTask = [
      { name: '提醒', value: this.__RemindHtml(isRemind), onItemClick: () => { Utility.toPage(SelectRemind, {}); }, showRight: true },
      { name: '截止时间', value: __day, onItemClick: this.__HandlerOpenDatePicker.bind(this), showRight: true },
      { name: '标签', value: label ? this.__LabelStyle(label) : '无', onItemClick: () => { Utility.toPage(SelectLabel, {}); }, showRight: true },
      { name: '重复', value: this.__IsRepeatHtml(isRepeat), onItemClick: () => { Utility.toPage(SelectRepeatWay, {}); }, showRight: true },
      { name: '工作方式', value: this.__WorkModeHtml(workMode), onItemClick: () => { Utility.toPage(SelectWorkWay, {}); }, showRight: true },
    ];

    const participate = [
      { name: '接收人', value: this.__getExtTaskUser(extTaskUser), onItemClick: this.__toPage.bind(this, ExecutivePeople), showRight: true },
    ];

    return (
      <div className={styles.content}>
        <textarea className={styles.inputDes} maxLength="500" ref="refInput" placeholder={placeholder}
          defaultValue={content} onBlur={this.__HandlerBlur.bind(this)}></textarea>
        <InfoItemList InfoItems={plan} />
        {/* <div className={styles.txt}>执行计划说明</div>*/}
        {execPlan === 'STANDARD' && <InfoItemList InfoItems={standardTask} />}
        <InfoItemList InfoItems={participate} />
        <div className={styles.btnContent + ' ' + (execPlan === 'STANDARD' ? styles.standardBtn : '')}>
          <RadusButton Text="提交" onClick={this.__commitTask.bind(this)} />
          {execPlan !== 'MEETING' && <div className={styles.ligthMode}>
            <RadusButton Text="关闭任务" onClick={this.__closeTask.bind(this)} />
            <RadusButton Text="删除任务" onClick={this.__deleteTask.bind(this)} />
            <RadusButton Text="复制任务" onClick={this.__HandlerCopyTask.bind(this)} />
          </div>}
        </div>
      </div>
    );
  }
}
